﻿using System;
using System.Collections.Generic;
using T.FAS.Runtime.Metadata.Entity.DataModel;

namespace T.FAS.Runtime.DataModel.Dao
{
    /// <summary>
    /// 领域模型持久化接口
    /// </summary>
    public interface ICompositeDataObjectDao
    {
        /// <summary>
        /// 数据领域对象
        /// </summary>
        /// <param name="dataObject">领域对象</param>
        void SaveCompositeDataObject(CompositeDataObject cdo);

        /// <summary>
        /// 保存领域对象元素集合
        /// </summary>
        /// <param name="elements">领域对象元素集合</param>
        void SaveCompositeNodeObjectElements(List<CompositeNodeObjectElement> elements);

        /// <summary>
        /// 保存领域对象关联集合
        /// </summary>
        /// <param name="associations">领域对象关联集合</param>
        void SaveDomainAssociation(List<Association> associations);

        /// <summary>
        /// 保存领域对象关联项集合
        /// </summary>
        /// <param name="associateItems">associateItems</param>
        void SaveDomainAssociationItem(List<AssociateItem> associateItems);

        /// <summary>
        /// 保存关联带出字段
        /// </summary>
        /// <param name="refElements">关联带出字段</param>
        void SaveAssociationRefElements(List<AssociationRefElement> refElements);

        /// <summary>
        /// 删除领域对象
        /// </summary>
        /// <param name="id">领域对象ID</param>
        void DeleteCompositeDataObject(string id);

        /// <summary>
        /// 删除领域对象
        /// </summary>
        /// <param name="id">领域对象ID</param>
        void DeleteCompositeDataObjects(List<string> ids);

        /// <summary>
        /// 获取领域对象
        /// </summary>
        /// <param name="id">领域对象ID</param>
        /// <returns>领域对象</returns>
        CompositeDataObject GetCompositeDataObject(string id);

        /// <summary>
        /// 获取领域对象
        /// </summary>
        /// <param name="id">领域对象ID</param>
        /// <returns>领域对象</returns>
        List<CompositeDataObject> GetCompositeDataObjects();
        /// <summary>
        /// 查询指定条件的领域对象
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        List<CompositeDataObject> GetCompositeDataObjectsByCondition(Dictionary<string,object> condition);

        /// <summary>
        /// 查询指定条件的领域对象条数据
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        int GetCompositeDataObjectCountByCondition(Dictionary<string, object> condition);
    }
}
